package com.itm.lqm.servlets.student;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;


import com.itm.lqm.entity.Student;
import com.itm.lqm.service.StudentService;

/**
 * Servlet implementation class updateStudent
 */
@WebServlet("/updateStudent")
public class updateStudent extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public updateStudent() {
        super();
        // TODO Auto-generated constructor stub
    }

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		//获取业务逻辑层对象，修改是先查询到该对象然后修改
		//String sid=request.getParameter("sid");
		int sid=Integer.parseInt(request.getParameter("sid"));//强制转换类型
		System.out.println(sid);
		StudentService ss=new StudentService();
		Student s= ss.findStudentBySid(sid);
		System.out.println(s);
		request.setAttribute("s", s);
		request.getRequestDispatcher("update.jsp").forward(request, response);	
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		
	}

}
